package com.day18me.Test;

import java.util.Objects;

public class Employee {
    private String name;
    private MyDate birthdat;

    public Employee() {
    }

    public Employee(String name, MyDate birthdat) {
        this.name = name;
        this.birthdat = birthdat;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public MyDate getBirthdat() {
        return birthdat;
    }

    public void setBirthdat(MyDate birthdat) {
        this.birthdat = birthdat;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return name.equals(employee.name) &&
                birthdat.equals(employee.birthdat);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, birthdat);
    }

    @Override
    public String toString() {
        return "Employee{" +
                "姓名：" + name + '\'' +
                ", 生日：" + birthdat +
                '}';
    }
}
